home *** CD-ROM | disk | FTP | other *** search
/ Comix Games / Comix Games.iso / jetsons / install.exe / _SETUP.1 / JETSONS.EXE / JETSONS.dxr / 00046.ls < prev    next >
Encoding:
Text File  |  1996-11-19  |  2.7 KB  |  57 lines

  1. on CheckPods
  2.   global theFirstPodChannel, theSecondPodChannel, theThirdPodChannel, theFourthPodChannel, theFirstBuildingChannel, theLastBuildingChannel, theBackgroundVelocity
  3.   set theXVelocity to 2
  4.   set theYVelocity to 2
  5.   set podVelocity to theBackgroundVelocity / 2
  6.   repeat with j = theFirstPodChannel to theFourthPodChannel
  7.     if (the visible of sprite j = 1) and (the top of sprite j < (the stageBottom - the stageTop)) then
  8.       set found to -1
  9.       set oldXPos to the locH of sprite j
  10.       repeat with h = theFirstBuildingChannel to theLastBuildingChannel
  11.         if (j = theFirstPodChannel) and (the memberNum of sprite h = the number of member "Drop Off 1") then
  12.           set found to h
  13.         end if
  14.         if (j = theSecondPodChannel) and (the memberNum of sprite h = the number of member "Drop Off 2") then
  15.           set found to h
  16.         end if
  17.         if (j = theThirdPodChannel) and (the memberNum of sprite h = the number of member "Drop Off 3") then
  18.           set found to h
  19.         end if
  20.         if (j = theFourthPodChannel) and (the memberNum of sprite h = the number of member "Drop Off 4") then
  21.           set found to h
  22.         end if
  23.       end repeat
  24.       if found <> -1 then
  25.         if (podVelocity < 0) and (the locH of sprite found < the locH of sprite j) and (the locH of sprite found < (the locH of sprite j + podVelocity)) then
  26.           set the locH of sprite j to the locH of sprite j + podVelocity
  27.         else
  28.           if (podVelocity > 0) and (the locH of sprite found > the locH of sprite j) and (the locH of sprite found > (the locH of sprite j + podVelocity)) then
  29.             set the locH of sprite j to the locH of sprite j + podVelocity
  30.           end if
  31.         end if
  32.         if (the locH of sprite found < (the locH of sprite j - theXVelocity)) and (the locH of sprite found < the locH of sprite j) then
  33.           set the locH of sprite j to the locH of sprite j - theXVelocity
  34.         else
  35.           if (the locH of sprite found >= (the locH of sprite j + theXVelocity)) and (the locH of sprite found >= the locH of sprite j) then
  36.             set the locH of sprite j to the locH of sprite j + theXVelocity
  37.           end if
  38.         end if
  39.       else
  40.         set the locH of sprite j to the locH of sprite j + podVelocity
  41.         if podVelocity > 0 then
  42.           set the locH of sprite j to the locH of sprite j + theXVelocity
  43.         else
  44.           if podVelocity < 0 then
  45.             set the locH of sprite j to the locH of sprite j - theXVelocity
  46.           end if
  47.         end if
  48.       end if
  49.       set yDiff to sqrt(abs(oldXPos - the locH of sprite j))
  50.       if yDiff <= 0 then
  51.         set yDiff to 1
  52.       end if
  53.       set the locV of sprite j to the locV of sprite j + yDiff
  54.     end if
  55.   end repeat
  56. end
  57.